<?php
namespace Tbf\Crypto\Password\Plan;
use Tbf\Crypto\Password\PlanInterface;
use Tbf\Util\StringUtil;
/**
* 简单md5hex
* 非常不安全,不要用于加密已有密码
* 密码格式
* 原文a123456 $md5hex$dc483e80a7a0bd9ef71d8cf973673924$
 * @deprecated
*/
class Md5HexPlan implements PlanInterface{
	function hash($plain){
		return '$md5hex$'.md5($plain).'$';
	}
	function verify($plain,$hashed){
		$data = explode('$',$hashed);
		return md5($plain)==$data[2];
	}
	function support($hashed){
		if (StringUtil::startWith($hashed,'$md5hex$')){
			return true;
		}
		return false;
	}
}